/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Filename      : mpu_outband_cmd.h
 * Version       : Initial Draft
 * Creation time : 2023/08/26
 * Last Modified :
 * Description   : SMBUS protocol out-of-band commands
 */

#ifndef MPU_OUTBAND_SMBUS_CMD_H
#define MPU_OUTBAND_SMBUS_CMD_H

/**
 * @brief SMBUS command code
 */

 /* SMBUS 命令字, 操作码定义，与平台保持一致 */
typedef enum {
    SMB_OPC_ABILITY = 0x0,  /**< collect ability info,connect to bmc framework @see smb_ability_s */
    SMB_OPC_DEVICE_HEALTH = 0x1, /**< get device health status @see struct smb_device_health_s */
    SMB_OPC_ERR_CODE = 0x2,        /**< get error code when status is not 0  @see smb_com_res_s */
    SMB_OPC_TEMP = 0x3,            /**< get temperature @see smb_temperature_s */
    SMB_OPC_FIRMWARE_VER = 0x05,   /**< get fw version @see smb_firmware_ver_s */
    SMB_OPC_TEMP_THRESHOLD = 0x7,  /**< set or get temp threshold @see smb_temp_threshold_data_s */
    SMB_OPC_LOG = 0x0C,            /**< get log @see smb_log_s */
    SMB_OPC_LAST_WORD = 0x0D,      /**< get last word @see smb_log_s */
    SMB_OPC_ROUTING_INSPEC = 0x0E, /**< get inspec info @see smb_log_s */

    /* L2NIC */
    SMB_OPC_SET_VLAN_CFG = 0x20, /**< set vlan info @see smb_log_s */

    /* SLT opcode define add opc need modify get tx len */
    SMB_SLT_OPC_WR = 0x50, /**< STL write reg data @see smb_read_write_reg_s */
    SMB_SLT_OPC_RD = 0x51, /**< STL read reg data @see smb_read_write_reg_s */
    SMB_SLT_OPC_TEMP = 0x52, /**< reversed */

    SMB_OPC_MAC_ADDR = 0x404,      /**< get mac addr @see smb_mac_addr_s */
    SMB_OPC_PCIE_DFX = 0xffffffff, /* pcie dfx带外暂时不实现 */

    /* MAG */
    SMB_OPC_SFP_TEMP_THRESHOLD = 0x8,  /**< get or set sfp temp threshold addr @see smb_sfp_temp_threshold_s */
    SMB_PANGEA_V6_OPC_SFP_TEMP = 0x10, /**< PANGEA_V6 get sfp temp @see smb_sfp_temp_threshold_s */
    SMB_PANGEA_V6_OPC_PHY_TEMP = 0x15, /**< not supported */
    SMB_OPC_SFP_TEMP = 0x400,          /**< get sfp temperature @see smb_sfp_temp_s */
    SMB_OPC_LINK_STATUS = 0x403,       /**< get link status @see smb_link_stat_s */
    SMB_OPC_PHY_TEMP = 0x405,          /**< not supported */
    SMB_OPC_SFP_ID = 0x407,             /**< get sfp id @see smb_sfp_id_s */

    /* IMU */
    IMU_MCU_OPC_GET_SPU_TEMP = 0x10f0, /**< get Totem temperature @see smb_spu_temp_s */
    IMU_MCU_OPC_SET_SPU_FREQ_UP,       /**< set Totem frequency up @see smb_spu_freq_resp_s */
    IMU_MCU_OPC_SET_SPU_FREQ_DOWN,     /**< set Totem frequency down @see smb_spu_freq_resp_s */
    IMU_MCU_OPC_ENABLE_PWRLIMIT,       /**< enable powerlimit @see smb_spu_pwrlimit_en_s */
    IMU_MCU_OPC_DISABLE_PWRLIMIT,      /**< disable powerlimit @see smb_spu_pwrlimit_en_s */
    IMU_MCU_OPC_GET_SPU_RAS_INFO_NUM,  /**< get Totem RAS info num @see smb_spu_ras_num_s */
    IMU_MCU_OPC_GET_SPU_RAS_INFO,      /**< get Totem RAS info @see smb_spu_ras_s */

    SMB_OPC_CMD_MAX
} SMBUS_OP_CODE_E;

#endif